# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=py3-cytoolz
_pkgorig=cytoolz
pkgver=0.11.2
pkgrel=1
pkgdesc="Cython implementation of Toolz: High performance functional utilities"
url="https://github.com/pytoolz/cytoolz"
arch="all"
license="BSD-3-Clause"
depends="python3 cython py3-toolz"
checkdepends="py3-pytest"
makedepends="python3-dev py3-setuptools"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/c/cytoolz/cytoolz-$pkgver.tar.gz
do-not-package-tests.patch"
builddir="$srcdir/$_pkgorig-$pkgver"

build() {
	# C extension
	python3 setup.py build_ext --inplace --with-cython

	# Python extension
	python3 setup.py build
}

check() {
	local python_version=$(python3 -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
	export PYTHONPATH="build/lib.linux-$CARCH-$python_version/:$PYTHONPATH"
	echo "$PYTHONPATH"
	pytest -v
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"
}

sha512sums="
7df91df94eee56097798ab75222a8c48d7bab042bfb284230c8888121a166fbf356a13ee49dc5fc54d5a8aad3c7bfbe0e4225ba20dbe36927655154e93b7bd13  py3-cytoolz-0.11.2.tar.gz
c235a083f24a054da8ff2a533c9e0fb942d7cd3a82be66e84280b2884b41d2c74d6d07e154c3d47140586c3e0087ce6b0fa1a8e96d00cfb3d3471803fddac113  do-not-package-tests.patch
"
